package com.ssy.lingxi.member.merchant.api.constant;

import com.ssy.lingxi.common.constant.member.RoleTypeEnum;

import java.util.Arrays;

/**
 * 交易评价记录状态枚举
 * @author yzc
 * @version 2.0.0
 * @date 2020/10/21
 */
public enum TradeCommentHistoryStatusEnum {

    SHOW(1, "显示"),

    HIDE(2, "隐藏");

    private Integer code;
    private String message;

    TradeCommentHistoryStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getCodeMsg(Integer code) {
        RoleTypeEnum status = Arrays.stream(RoleTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return status == null ? "未知" : status.getMessage();
    }
}
